﻿using KingsSharp.Common.Data;
using KingsSharp.Core;
using CRM.Admin.Contracts.Model.Sys;
using CRM.Admin.Contracts.Dto.Sys;
using System;
using System.Linq;

namespace CRM.Admin.Contracts.Contract.Sys
{
    /// <summary>
    /// 系统字典维护接口
    /// </summary>
    public interface IDictionaryService : IDependency
    {
        #region 字典类别
        /// <summary>
        /// 字典类别集合
        /// </summary>
        IQueryable<DictionaryType> ItemDictionaryType { get; }

        /// <summary>
        /// 以dto为载体添加字典类别
        /// </summary>
        /// <param name="dtos"></param>
        /// <returns></returns>
        OperationResult AddDictionaryType(params DictionaryTypeDto[] dtos);

        /// <summary>
        /// 以dto为载体编辑字典类别
        /// </summary>
        /// <param name="dtos"></param>
        /// <returns></returns>
        OperationResult EditDictionaryType(params DictionaryTypeDto[] dtos);

        /// <summary>
        /// 删除指定id的字典类别
        /// 删除时、同时将删除类别下的字典
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        OperationResult DeleteDictionaryType(params Guid[] ids);
        #endregion


        #region 字典信息
        /// <summary>
        /// 字典信息集合
        /// </summary>
        IQueryable<Dictionary> ItemDictionary { get; }

        /// <summary>
        /// 以dto为载体添加字典信息
        /// </summary>
        /// <param name="dtos"></param>
        /// <returns></returns>
        OperationResult AddDictionary(params DictionaryDto[] dtos);

        /// <summary>
        /// 以dto为载体编辑字典信息
        /// </summary>
        /// <param name="dtos"></param>
        /// <returns></returns>
        OperationResult EditDictionary(params DictionaryDto[] dtos);

        /// <summary>
        /// 删除指定id的字典信息
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        OperationResult DeleteDictionary(params Guid[] ids);
        #endregion
    }
}
